﻿using StudentManagement.Model.Entitys;
using StudentManagement.Model.Enums;
using System;
using System.Collections.Generic;
using System.Text;

namespace StudentManagement.ViewModel
{
    public class StudentViewModel : VMbase
    {
        public int Id { get; set; }

        private string _number;
        /// <summary>
        /// 编号/学号
        /// </summary>
        public string Number
        {
            get
            {
                return _number;
            }
            set
            {
                _number = value;
                VmSet(nameof(Number));
            }
        }

        private string _name;
        /// <summary>
        /// 名称
        /// </summary>
        public string Name
        {
            get
            {
                return _name;
            }
            set
            {
                _name = value;
                VmSet(nameof(Name));
            }
        }

        private byte _sex;
        /// <summary>
        /// 性别（1-男 0-女）
        /// </summary>
        public byte Sex
        {
            get
            {
                return _sex;
            }
            set
            {
                _sex = value;
                VmSet(nameof(Sex));
            }
        }

        private int? _age;
        /// <summary>
        /// 年龄
        /// </summary>
        public int? Age
        {
            get
            {
                return _age;
            }
            set
            {
                _age = value;
                VmSet(nameof(Age));
            }
        }

        private DateTime? _dateBirth;
        /// <summary>
        /// 出生日期
        /// </summary>
        public DateTime? DateBirth
        {
            get
            {
                return _dateBirth;
            }
            set
            {
                _dateBirth = value;
                VmSet(nameof(DateBirth));
            }
        }

        private int _classesId;
        /// <summary>
        /// 班级Id
        /// </summary>
        public int ClassesId
        {
            get
            {
                return _classesId;
            }
            private set
            {
                _classesId = value;
                //VmSet(nameof(ClassesId));
            }
        }

        private ClassesEntity _classes;
        /// <summary>
        /// 班级
        /// </summary>
        public ClassesEntity Classes
        {
            get
            {
                return _classes;
            }
            set
            {
                _classes = value;
                if (null != _classes)
                {
                    _classesId = _classes.Id;
                }
                VmSet(nameof(Classes));
            }
        }
    }
}
